PELogOnServer allows you to log on to a SQL Server without specifying a particular report file. Use the following code as an example of how to log on to a Server with PELogOnServer, then log off with PELogOffServer:
struct PELogOnInfo logOnInfo;
// Initialize structure
logOnInfo.StructSize = PE_SIZEOF_LOGON_INFO;
lstrcpy(logOnInfo.ServerName,"Server");
lstrcpy(logOnInfo.DatabaseName,"database");
lstrcpy(logOnInfo.UserID,"user ID");
lstrcpy(logOnInfo.Password, "password");
// Connect to the server
if(!PELogOnServer("PDSODBC.DLL", &logOnInfo)){
// Handle error
PEClosePrintJob(Job);
// close the print job
return;
}
if(!PELogOffServer("PDSODBC.DLL", &logOnInfo)){
// Handle error
}
Seagate Software IMG Holdings, Inc. http://www.seagatesoftware.com Support services: http://support.seagatesoftware.com |